package com.hlx.mall.coupon.controller;

import com.hlx.mall.coupon.domain.SmsCoupon;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
@RequestMapping("/coupon/coupon")
public class CouponController {
    
    @GetMapping("/member/list")
    public SmsCoupon test() {
        SmsCoupon smsCoupon = new SmsCoupon();
        smsCoupon.setCoupon_name("满100减10");
        return smsCoupon;
    }
    
    @Value("${configdata.name}")
    private String name;
    @Value("${configdata.age}")
    private Integer age;
    
    @GetMapping("/test") 
    public String te() {
        return name + age;
    }
}
